<?xml version="1.0" encoding="utf-8" ?>
<taskrunner name="autostart" version="1.0" date="2008-10-30" maxthreads="1">

  <!-- checks installed version. 
  
  Dependencies:
    the global property ¤{install.type} must have been set to either INSTALL, REINSTALL or UNINSTALL
  -->
  

  <includes>
    <file name="vida.install.settings.xml" />
  </includes>

  <properties>
    <property key="registry.autostart.key" value="SOFTWARE\Microsoft\Windows\CurrentVersion\Run"/>
    <property key="vidamonitor.name" value="VidaMonitor"/>
    <property key="eupdatelauncher.name" value="VIDA eUpdate Launcher"/>
  </properties>

  <tasks>


    



    <!-- INSTALL -->
    <task name="autostart.vidamonitor" condition="¤{install.type}=INSTALL" typename="@RegistrySetLocalMachine">
      <description>
        Adds VidaMonitor to StartUp folder for Windows.
      </description>
      <errormessage>
        Could not create auto start entry for Vida Monitor in the local registry.
      </errormessage>
      <dependencies list="set.install.type"/>
      <parameters>
        <parameter name="subkey" value="${registry.autostart.key}"/>
        <parameter name="value.name" value="${vidamonitor.name}"/>
        <parameter name="value" value="${target.vidamonitor.fullpath}"/>
        <parameter name="check.path" value="true"/>

      </parameters>
    </task>

    <task name="autostart.eupdatelauncher" condition="¤{install.type}=INSTALL" typename="@RegistrySetLocalMachine">
      <description>
        Adds eUpdate Launcher to StartUp folder for Windows.
      </description>
      <errormessage>
        Could not create auto start entry for eUpdate launcher in the local registry.
      </errormessage>
      <dependencies list="set.install.type"/>
      <parameters>
        <parameter name="subkey" value="${registry.autostart.key}"/>
        <parameter name="value.name" value="${eupdatelauncher.name}"/>
        <parameter name="value" value="${target.eupdate.launcher.fullpath}"/>
        <parameter name="check.path" value="true"/>
      </parameters>
    </task>

    <!-- UNINSTALL-->
    <task name="remove.vidamonitor.autostart" condition="¤{install.type}=UNINSTALL OR ¤{install.type}=REINSTALL" typename="@RegistryRemoveLocalMachineValue">
      <description>
        Removes auto-start settings for VidaMonitor in the windows registry
      </description>
      <dependencies list="set.install.type"/>
      <parameters>
        <parameter name="subkey" value="${registry.autostart.key}"/>
        <parameter name="value.name" value="${vidamonitor.name}"/>

      </parameters>
    </task>

    <task name="remove.eUpdateLauncher.autostart" condition="¤{install.type}=UNINSTALL OR ¤{install.type}=REINSTALL" typename="@RegistryRemoveLocalMachineValue">
      <description>
        Removes auto-start settings for VidaMonitor in the windows registry
      </description>
      <dependencies list="set.install.type"/>
      <parameters>
        <parameter name="subkey" value="${registry.autostart.key}"/>
        <parameter name="value.name" value="${eupdatelauncher.name}"/>

      </parameters>
    </task>
    
  </tasks>
</taskrunner>